﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.Services;
using SdmxMl.Multiplexor;

namespace SdmxMailNotifier
{
    /// <summary>
    /// Summary description for Notification
    /// </summary>
    [WebService(Namespace = "http://www.bfs.admin.ch/sms/sdmx-notification-service/2012/07/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Notification : System.Web.Services.WebService
    {
        [WebMethod(Description = "This method runs the notification of the users. " +
                                 "For each user that has not been notified during the current notification period, " +
                                 "we compute the artefacts that has been changed after the last notification and send them through a mail notification.")]
        public void NotifyUsers()
        {
            ((Notifier) Application["Notifier"]).NotifyUsers((UsersManager) Application["Users"]);
        }
    }
}
